import request from '@/utils/request';
import type { AxiosPromise } from '@/utils/request';
import type { PaymentProgressVO, PaymentProgressForm, PaymentProgressQuery } from '@/pagesA/api/workflow/paymentProgress/types';

/**
 * 查询令讯进度付款申请列表
 * @param query
 * @returns {*}
 */

export const listPaymentProgress = (query?: PaymentProgressQuery): AxiosPromise<PaymentProgressVO[]> => {
  return request({
    url: '/workflow/paymentProgress/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询令讯进度付款申请详细
 * @param id
 */
export const getPaymentProgress = (id: string | number): AxiosPromise<PaymentProgressVO> => {
  return request({
    url: '/workflow/paymentProgress/' + id,
    method: 'get'
  });
};

/**
 * 新增令讯进度付款申请
 * @param data
 */
export const addPaymentProgress = (data: PaymentProgressForm) => {
  return request({
    url: '/workflow/paymentProgress',
    method: 'post',
    data: data
  });
};

/**
 * 修改令讯进度付款申请
 * @param data
 */
export const updatePaymentProgress = (data: PaymentProgressForm) => {
  return request({
    url: '/workflow/paymentProgress',
    method: 'put',
    data: data
  });
};

/**
 * 删除令讯进度付款申请
 * @param id
 */
export const delPaymentProgress = (id: string | number | Array<string | number>) => {
  return request({
    url: '/workflow/paymentProgress/' + id,
    method: 'delete'
  });
};
